package com.rz.htk.message.controller;

import com.rz.core.kit.RespKit;
import com.rz.core.resp.ResultResp;
import com.rz.htk.message.entity.Message;
import com.rz.htk.message.entity.vo.MessageDeleteParam;
import com.rz.htk.message.service.IMessageService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/message")
public class MessageController {

    @Resource
    private IMessageService iMessageService;

    @PostMapping("/getPage")
    public ResultResp getPage(@RequestBody Message message){
        return RespKit.success(iMessageService.getPage(message));
    }
    @PostMapping("/saveMessage")
    public ResultResp saveMessage(@RequestBody Message message){
        return RespKit.success(iMessageService.saveMessage(message));
    }

    @PostMapping("/batchDelete")
    public ResultResp batchDelete(@RequestBody MessageDeleteParam messageDeleteParam){
        return RespKit.success(iMessageService.batchDelete(messageDeleteParam));
    }


}
